package com.tjsinfo.tjsoa.addresslist.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tjsinfo.tjsoa.addresslist.bo.IAddressListUserBo;
import com.tjsinfo.tjsoa.addresslist.vo.AddressListUser;
import com.tjsinfo.tjsoa.system.vo.User;

public class SelectHighAddressListUserNameAction extends Action{
	private IAddressListUserBo listUserBo;
	public IAddressListUserBo getListUserBo() {
		return listUserBo;
	}
	public void setListUserBo(IAddressListUserBo listUserBo) {
		this.listUserBo = listUserBo;
	}
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		
		String lie = request.getParameter("lie");
		String value = request.getParameter("inputvalue");
		if (lie.equals("birthday")) {
			value = request.getParameter("birthday");
		}
		String moduleType = request.getParameter("moduleType");
		HttpSession session = request.getSession();
		User user = (User) session.getAttribute("user");
		List<AddressListUser> list = listUserBo.selectHighListUser(lie, value, Short.valueOf(moduleType),String.valueOf(user.getUser_id()));
		request.setAttribute("list", list);
		return mapping.findForward("ok");
	}
}
